Install Postfix
2014/08/22 |
Install Postfix to configure SMTP server. SMTP uses 25/TCP.
|
|
[1] | Postfix is installed even if CentOS system was installed with [Minimal Install], but if Postfix is not, Install it first like follows. |
[root@mail ~]# yum -y install postfix
|
[2] | This example shows to configure SMTP-Auth to use Dovecot's SASL function. |
[root@mail ~]#
vi /etc/postfix/main.cf # line 75: uncomment and specify the hostname myhostname = mail.srv.world
# line 83: uncomment and specify the domain name mydomain = srv.world
# line 99: uncomment myorigin = $mydomain # line 116: change inet_interfaces = all
# line 119: change if you use only IPv4 inet_protocols = ipv4
# line 164: add mydestination = $myhostname, localhost.$mydomain, localhost , $mydomain
# line 264: uncomment and specify your local network mynetworks = 127.0.0.0/8, 10.0.0.0/24
# line 419: uncomment (use Maildir) home_mailbox = Maildir/ # line 571: add smtpd_banner = $myhostname ESMTP
# add follows to the end # limit an email size for 10M message_size_limit = 10485760 # limit a mailbox for 1G mailbox_size_limit = 1073741824
# for SMTP-Auth smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = $myhostname smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject /etc/rc.d/init.d/postfix start Starting postfix: [ OK ] [root@mail ~]# chkconfig postfix on |
[3] | If IPTables is running, allow SMTP port. SMTP uses 25/TCP. For "-I INPUT 5" section below, Replace it to your own environment. |
[root@dlp ~]# iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT |